package inheritance;

public abstract class AbstractAnimal {

    public abstract void idenf();

    public abstract String name();


}

class Dog extends AbstractAnimal{

    @Override
    public void idenf() {
        System.out.println("I am Dog");
    }

    @Override
    public String name() {
        return "Dog";
    }

    public void hobbit(){
        System.out.println("Dog like Funny");
    }

    public static void main(String[] args) {
        AbstractAnimal abstractAnimal = new Dog();
        abstractAnimal.name();

        //抽象类声明的对象也只能调用抽象类中声明的方法
//        abstractAnimal.hobbit();

        Dog dog = new Dog();
        dog.hobbit();
    }
}
